home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
G-Games
/
(c)gb.d64
/
blackjack 1.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
134 lines
40 REM ********************************
50 REM * ALTERED SLIGHTLY AT 0328H ON *
60 REM * APRIL THE 2ND, 1985 BY *
70 REM * DAVID BRADLEY *
80 REM ********************************
100 DIMC(51),P$(12),V(12),S$(3),Y(5),M(5),B$(4),K$(5)
105 PRINTCHR$(142):PRINTCHR$(8):POKE53280,0:POKE53281,0:PRINT""
110 F$="[213][192][192][192][201][157][221][157][221][157][221][157][221][157][221][157][203][157][157][192][157][157][192][157][157][192][157][157][202][157][145][221][157][145][221][157][145][221][157][145][221][157][145][221]"
120 DATA"A "," "," X "," "," A"
130 DATA"2 "," X "," "," X "," 2"
140 DATA"3 "," X "," X "," X "," 3"
150 DATA"4 ","X X"," ","X X"," 4"
160 DATA"5 ","X X"," X ","X X"," 5"
170 DATA"6 ","X X","X X","X X"," 6"
180 DATA"7 ","X X","XXX","X X"," 7"
190 DATA"8 ","XXX","X X","XXX"," 8"
200 DATA"9 X","X X","XXX","X X","X 9"
210 DATA"10X","XXX","X X","XXX","X10"
220 DATA"J X","A ","C ","K ","X J"
230 DATA"Q X","U ","E ","E ","N Q"
240 DATA"K X","I ","N ","G ","X K"
250 FORJ=0TO12:READP$(J):FORK=0TO3:READP$:P$(J)=P$(J)+"[157][157][157]"+P$:NEXTK
260 P$(J)=P$(J)+"[145][145][145][145][145]":NEXTJ
270 DATA "[193]","[216]","[211]","[218]"
280 FORJ=0TO3:READS$(J):NEXTJ
290 DATA 1,2,3,4,5,6,7,8,9,10,10,10,10
300 FORJ=0TO12:READV(J):NEXTJ
310 V$=""
320 H$=""
330 N$=" [157][157][157] [157][157][157] [157][157][157] [157][157][157] "
340 DATA "I'LL HAVE ONE,TOO","THAT CALLS FOR A DRINK","MAYBE I'LL HAVE ANOTHER"
350 DATA "I'LL JUST HAVE A SNORT HERE","ANOTHER LI'L DRINK"
360 FORJ=0TO4:READB$(J):NEXTJ
370 DATA "",", FRIEND",", PAL",", BUDDY",", OLD BUDDY"
380 FORJ=1TO5:READK$(J):NEXTJ
390 T=TI
400 X=RND(-T):T=T/1000:IFT>=1GOTO400
410 PRINT"[147] BUTTERFIELD SOCIAL & RECREATIONAL CLUB"
420 INPUT"HOW MUCH MONEY DO YOU HAVE";F
430 IFF<100THENPRINT"SCRAM, CHEAPSKATE!":END
440 M1=1:K$="#"
450 M1=M1*10:IFF/M1>50GOTO450
460 F1=INT(10*RND(1)+12)*M1
470 IFF1<FTHENPRINT"MEMBERSHIP FEES ARE $";F-F1:F=F1
480 PRINT"MINIMUM BET IS $";M1:F1=F
490 PRINT"DRINKS ARE ON THE HOUSE--":PRINT"POUR YOURSELF ONE WHILE I SHUFFLE."
500 IFRND(1)*5<D1*D2GOTO1100
510 IFD1=5GOTO1020
520 PRINTB$(D1):PRINT"SHUFFLING..":D1=D1+1
530 FORJ=0TO51:C(J)=J:NEXTJ
540 FORJ=0TO51:S=INT(RND(1)*52):S1=C(J):C(J)=C(S):C(S)=S1:NEXTJ:D=51
550 IFD<9GOTO500
560 IFF<M1GOTO1190
570 IFASC(K$)<>33ANDRND(1)>.7THENREADK$:PRINTK$
575 PRINT"YOU HAVE $";F;":YOUR BET";K$(D1);:INPUTB:IFB>FGOTO570
580 IFB=0GOTO1200
590 IFB<M1THENPRINT"MINIMUM BET IS $";M1;:GOTO570
600 PRINT"[147]":M=0:Y=0:GOSUB850:GOSUB860:GOSUB940:GOSUB840:GOSUB860:GOSUB940
610 GOSUB850:GOSUB860:C$=N$:GOSUB940
620 GOSUB840:GOSUB860:GOSUB940
630 A=0:T=0:FORJ=1TOY:C=Y(J):GOSUB860:NEXTJ
640 T1=T+A:IFT1>21THENT1=T
650 PRINT" "
660 PRINT"YOUR TOTAL=";T1;"[157] ";
670 IFT1>21THENPRINT"*BUSTED*":GOTO830
680 IFY=5THENPRINT"*5-CARD WIN*":GOTO810
690 INPUT"..HIT OR STAND";Z$
700 IFASC(Z$)<83THENGOSUB840:GOSUB860:GOSUB940:GOTO640
710 A=0:T=0:X1=9:FORX=1TOM:C=M(X):GOSUB860:NEXTX:GOSUB940
720 T2=T+A:IFT2>21THENT2=T
730 PRINTLEFT$(V$,17);"MY TOTAL=";T2;"[157] ";
740 IFT2>21THENPRINT"*BUSTED*":GOTO810
750 IFM=5THENPRINT"*5-CARD WIN*":GOTO830
760 IFT>15ORT2>17GOTO780
770 GOSUB850:GOSUB860:GOSUB940:GOTO720
780 IFT2>T1GOTO830
790 IFT1>T2GOTO810
800 PRINTV$;" NO WIN ":GOTO550
810 PRINTV$;" YOU WIN ":F=F+B:W1=W1+1:IFW1=3GOTO950
820 GOTO550
830 PRINTV$;"I WIN":F=F-B:W1=W2:GOTO550
840 Y=Y+1:X=Y:X1=2:C=C(D):D=D-1:Y(Y)=C:RETURN
850 M=M+1:X=M:X1=9:C=C(D):D=D-1:M(M)=C:RETURN
860 V=INT(C/4):S=C-V*4:S$=S$(S)
870 P$=P$(V):C$="":FORK=1TOLEN(P$)
880 M$=MID$(P$,K,1):IFM$="X"THENM$=S$
890 C$=C$+M$:NEXTK:T=T+V(V):IFV=0THENA=10
900 H=INT(X*5+RND(1)*D1-D1/2+.5):V1=X1+INT(RND(1)*D1-D1/2+.5)
910 IFX=2THENH=10:V1=X1
920 IFV1<2THENV1=2
930 RETURN
940 PRINTLEFT$(V$,V1);LEFT$(H$,H);F$;C$:RETURN
950 PRINT"[211]HI..MY NAME IS TOOTS[211]"
960 PRINT"[211]SURE LIKE YOUR STYLE[211]"
970 PRINT"[211]COULDN'T HELP NOTICING YOUR FLASHY[211]"
980 PRINT"[211]PLAYING AND YOUR BIG WALLET[211]"
990 PRINT"[211]MAYBE WE CAN GET TOGETHER LATER[211]"
1000 PRINT"[211]I'LL BE OVER BY THE CASHIER[211]"
1010 W2=4:GOTO550
1020 FORJ=1TO1E3:NEXT:PRINT"[147]LESH HAVE NUTHER DRINK WHILE I SHUFFLE"
1030 FORJ=1TO20:PRINTLEFT$(V$,4+RND(1)*15);LEFT$(H$,RND(1)*30+1);F$;N$:NEXTJ
1040 PRINTV$;"SHORRY, I DROPPED THE CARDS..":FORJ=1TO2000:NEXTJ
1050 PRINT" ANNOUNCEMENT "
1060 PRINT"THE MANAGEMENT REGRETS THE DEALER"
1070 PRINT"HAVING SLID UNDER YOUR TABLE"
1080 PRINT"A NEW DEALER WILL REPLACE HIM."
1090 D1=0:D2=1:GOTO500
1100 FORJ=1TO1E3:NEXT:PRINT"[147]*OPEN UP - THIS IS THE POLICE*"
1110 PRINT"WHAT?":PRINT"*YOU GOT A LICENSE FOR GAMBLING*"
1120 PRINT"UH..":PRINT"*OK, YOU BETTER COME ALONG*"
1130 PRINT"BUT..":PRINT"*THIS YOUR MONEY? IT'S EVIDENCE*"
1140 PRINT"WELL..":PRINT"*OKAY,THAT'S IT .. EVERYBODY OUT"
1150 PRINT"*BUDDY, LET ME GIVE YOU SOME ADVICE*"
1160 PRINT"*NEVER GAMBLE ..":PRINT"*ESPECIALLY IN A JOINT LIKE THIS.*"
1170 PRINT"BEFORE THE RAID, YOU HAD $";F:PRINT"NOW YOU HAVE $0."
1180 PRINT"HAVE A NICE WALK HOME":END
1190 PRINT"BEAT IT - WE DON'T ALLOW DEADBEATS HERE"
1200 IFF>F1THENPRINT"YOU GAINED $";F-F1
1210 IFF<F1THENPRINT"YOU LOST $";F1-F
1220 IFF=F1THENPRINT"YOU BROKE EVEN!"
1230 PRINT"..AND LEFT WITH $";F
1240 DATA "I USED TO WORK IN VEGAS, YOU KNOW"
1250 DATA "WHAT A CRUMMY JOINT THIS IS."
1260 DATA "BOY, WE GET WEIRD CUSTOMERS HERE."
1270 DATA "A BUNCH OF CHEAPSKATES RUN THIS DUMP."
1280 DATA "THE ROULETTE WHEEL IS MORE FUN."
1290 DATA "FOOD HERE IS LOUSY."
1300 DATA "I GET SICK OF LOOKING AT THESE CARDS."
1310 DATA "MY BOSS IS A MEAN OLD CRAB."
1320 DATA "MAYBE I SHOULD WORK AT THE RACES."
1330 DATA "THIS IS A LOUSY JOB, YOU KNOW."
1340 DATA "BIG DEAL; LAS VEGAS WITH PEELING PAINT"
1350 DATA "!IF MY MOTHER KNEW I WORKED HERE..."